package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Intervention generated by hbm2java
 */
@Entity
@Table(name = "Intervention", schema = "dbo", catalog = "CRM")
public class Intervention implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int interventionId;
	private InterventionType interventionType;
	private String libelle;
	private Date date;
	private Set<AffectationAnomalie> affectationAnomalies = new HashSet<AffectationAnomalie>(0);

	public Intervention() {
	}

	public Intervention(int interventionId) {
		this.interventionId = interventionId;
	}

	public Intervention(int interventionId, InterventionType interventionType,
			String libelle, Date date, Set<AffectationAnomalie> affectationAnomalies) {
		this.interventionId = interventionId;
		this.interventionType = interventionType;
		this.libelle = libelle;
		this.date = date;
		this.affectationAnomalies = affectationAnomalies;
	}

	@Id
	@GeneratedValue
	@Column(name = "interventionId", unique = true, nullable = false)
	public int getInterventionId() {
		return this.interventionId;
	}

	public void setInterventionId(int interventionId) {
		this.interventionId = interventionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "interventionTypeId")
	public InterventionType getInterventionType() {
		return this.interventionType;
	}

	public void setInterventionType(InterventionType interventionType) {
		this.interventionType = interventionType;
	}

	@Column(name = "libelle", length = 100)
	public String getLibelle() {
		return this.libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date", length = 23)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "intervention")
	public Set<AffectationAnomalie> getAffectationAnomalies() {
		return this.affectationAnomalies;
	}

	public void setAffectationAnomalies(Set<AffectationAnomalie> affectationAnomalies) {
		this.affectationAnomalies = affectationAnomalies;
	}

}
